package org.docmanagement.forms;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionMapping;
import org.docmanagement.commons.struts.CommonForm;

/**
 * Created on 11 oct. 2004
 * @author eveno
 */
public class SearchForm extends CommonForm
{
	private static final long serialVersionUID = 1L;

    private String titlePattern = null;
    private String contentPattern = null;
    private String descriptionPattern = null;
    private Integer[] keywordIds = new Integer[0];

    public String getDescriptionPattern() {
		return descriptionPattern;
	}

	public void setDescriptionPattern(String descriptionPattern) {
		this.descriptionPattern = descriptionPattern;
	}

	public String getContentPattern()
    {
        return contentPattern;
    }

    public void setContentPattern(String contentPattern)
    {
        this.contentPattern = contentPattern;
    }

    public String getTitlePattern()
    {
        return titlePattern;
    }

    public void setTitlePattern(String titlePattern)
    {
        this.titlePattern = titlePattern;
    }

    public Integer[] getKeywordIds()
    {
        return keywordIds;
    }

    public void setKeywordIds(Integer[] ids)
    {
        LogFactory.getLog(getClass()).info("Setting keywordIds with: "+ids);
        this.keywordIds = ids;
    }

    public void reset(ActionMapping mapping, HttpServletRequest request)
    {
        super.reset(mapping, request);
        titlePattern = null;
        contentPattern = null;
        keywordIds = new Integer[0];
    }
}
